package com.apes.project.jekunAuto.timeTask.scm;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.apes.framework.plugin.esb.api.SimpleRequest;
import com.apes.framework.util.MapUtil;
import com.apes.pi.service.PiManager;
import com.apes.project.jekunAuto.timeTask.BaseService;
import com.apes.scm.masterdata.area.model.Area;
import com.apes.scm.masterdata.area.service.AreaService;
import com.apes.scm.masterdata.area.service.CountryService;
import com.apes.scm.masterdata.contrast.model.ContrastPartyCode;
import com.apes.scm.masterdata.contrast.repository.ContrastPartyCodeRepository;
import com.apes.scm.masterdata.enumeration.model.Enumeration;
import com.apes.scm.masterdata.party.model.Corporate;
import com.apes.scm.masterdata.party.model.Party;
import com.apes.scm.masterdata.party.model.PartyIdentification;
import com.apes.scm.masterdata.party.model.PartyRole;
import com.apes.scm.masterdata.party.repository.PartyIdentificationRepository;
import com.apes.scm.masterdata.party.service.PartyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashSet;
import java.util.Set;

/**
 * Creator: zouyc
 * CreateDate: 2019-11-26 11:47
 * Description:
 **/
@Service("supplierInfoSynService")
public class SupplierInfoSynService extends BaseInfoSynService {

    @Autowired
    ContrastPartyCodeRepository contrastPartyCodeRepository;
    @Autowired
    PartyService partyService;
    @Autowired
    PartyIdentificationRepository partyIdentificationRepository;
    @Autowired
    AreaService areaService;
    @Autowired
    CountryService countryService;
    @Autowired
    PiManager piManager;

    public JSONArray synSupplierInfos(SimpleRequest simpleRequest) {
        return piManager.timedTaskSynErp("ipmUpateKHXXService.qrySupplier");
    }
    public void saveSupplierInfo(SimpleRequest simpleRequest){
        JSONObject simpleObj = simpleRequest.getJO();
        simpleObj.put("thisType","Supplier");
        synPartyBase(simpleObj);
    }
}